﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AvansRS.Domain;
using FluentNHibernate.Mapping;


namespace AvansRS.Data.Mapping
{
    public class EventMap : ClassMap<Event>
    {
       public EventMap()
       {
           Id(x => x.ID);
           Map(x => x.Name);
           Map(x => x.Description);
           Map(x => x.MaxRegistrations);
           References(x => x.Location)
                .Not.LazyLoad();
           HasMany(x => x.EventDates)
                .Not
                .LazyLoad();


           HasManyToMany(x => x.ApplicableEntities)
               .Not
               .LazyLoad();
       }
    }
}
